<template>
  <div>
    <!-- <p>{{ message }}</p> -->
    <ul>
      <li v-for="item in items" :key="item.id">{{ item.name }}</li>
    </ul>
  </div>
</template>
<script>
import { mapActions, mapGetters } from 'vuex';
export default {
  computed: {
    ...mapGetters(['allItems']),
    items() {
      return this.$store.allItems;
    }
  },
  methods: {
    ...mapActions(['fetchItems'])
  },
  created() {
    this.fetchItems();
  }
}
</script>